/*
 * @Author: yl
 * @Date: 2024-04-09 16:47:33
 * @LastEditTime: 2024-05-22 11:16:08
 * @LastEditors: Please set LastEditors
 * @Description: 养殖品种管理接口 sheep-information
 */
import xjaxios from "@/api/axios-source_trace";
import req from "@/api/axios";

export default {
  /**
   * @description: 获取养殖品种列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getList(params) {
    return xjaxios.post("breedVariety/queryPageByCondition", params);
  },


  // /**
  //  * @description: 条件查询所有养殖品种
  //  * @param null *
  //  * @return {Object}
  //  */
  getByCondition(params) {
    return xjaxios.post("breedVariety/queryByCondition", {
      organizationNo: sessionStorage.organizationNo,
      ...params
    });
  },

  // /**
  //  * @description: 条件查询所有养殖品种-种植
  //  * @param null *
  //  * @return {Object}
  //  */
  queryPlantVariety(params) {
    return req.post("templateTenant/plantVariety/queryByCondition", {
      organizationNo: sessionStorage.organizationNo,
      ...params
    });
  },
   // /**
  //  * @description: 条件查询养殖品种图片
  //  * @param null *
  //  * @return {Object}
  //  */
  plantVarietyPicture(pictureNo) {
    return req.get(`templateTenant/plantVarietyPicture/queryByNo?no=${pictureNo}`);
  },
  /**
   * @description: 新增养殖品种信息
   * @param {Object} formData *
   * @return {Object}
   */
  add(formData) {
    // formData.organizationNo = sessionStorage.baseId;
    return xjaxios.post("breedVariety/add", {
      organizationNo: sessionStorage.organizationNo,
      ...formData
    });
  },
  /**
   * @description: 编辑养殖品种信息
   * @param {Object} formData *
   * @return {Object}
   */
  edit(formData) {
    return xjaxios.post("breedVariety/edit", formData);
  },
  /**
   * @description: 单个删除
   * @param {String} employeeId *
   * @return {Array}
   */
  del(no) {
    return xjaxios.get(`breedVariety/delByNo?no=${no}`);
  },
  delList(noList) {
    return xjaxios.post(`breedVariety/delListByNo`, { noList: noList });
  },
  // 查询品种图片
  queryByNo(no) {
    return req.get(`category/plantVarietyPicture/queryByNo?no=${no}`);
  },

};
